import requestURL from './utils.js'

/**
 * 获取公告详情
 * @param {Object} url 请求路径
 */
function getProDetails(url, token) {
	return uni.request({
		url: `${requestURL.localURL}/${url}`,
		header: {token: !!token ? token : requestURL.token},
		method: 'GET'
	}).then(data => {
		var [error, res] = data
		return res.data
	}).catch(err => {
		uni.showToast({
			title: 'Fail！',
			icon: 'none',
			duration: 2000
		});
	})
}

export default {
	getProDetails
}